<script setup>
import { useRouter } from 'vue-router'
import WelcomeDiv from '@/views/components/WelcomeDiv.vue'

const router = useRouter()

const toManage = () => {
  router.push('/manage')
}

const toUsing = () => {
  router.push('/using')
}
</script>

<template>
  <el-container>
    <el-header>
      <h1>欢迎您使用智慧停车场管理系统</h1>
      <WelcomeDiv />
    </el-header>

    <el-main>
      <el-row justify="center">
        <el-col :span="6">
          <el-button type="info" plain @click="toManage">
            前往管理页面
          </el-button>
        </el-col>
        <el-col :span="6">
          <el-button type="primary" plain @click="toUsing">
            前往使用页面
          </el-button>
        </el-col>
      </el-row>
    </el-main>

    <el-footer>©2024 Created by lt</el-footer>
  </el-container>
</template>

<style lang="scss" scoped>
.el-container {
  width: 100%;
  height: 100vh;
  background-color: #fff;

  .el-header {
    height: auto;
    background-color: var(--el-color-primary-light-8);
    margin-bottom: 10px;
    padding-bottom: 5px;

    h1 {
      text-align: center;
      font-size: 30px;
      color: #606266;
      height: 60px;
      line-height: 60px;
    }
  }

  .el-main {
    height: 100%;

    .el-row {
      height: 100%;

      .el-col {
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .el-button {
        width: 200px;
        height: 200px;
        border-radius: var(--el-border-radius-round);
        font-size: 20px;
        font-weight: bold;
      }
    }
  }

  .el-footer {
    background-color: #f2f3f5;
    font-size: 10px;
    text-align: center;
    height: 40px;
    line-height: 40px;
  }
}
</style>
